package com.example.util.common;

import lombok.extern.slf4j.Slf4j;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/9/21 11:43
 */
@Slf4j
public class FileUtil {

    public static List<String> readText2(String source){
        List<String> stringList=new ArrayList<>(10000);
        File file = new File(source);
        try (BufferedReader reader= new BufferedReader(new FileReader(file))){
            String tempStr;
            while ((tempStr = reader.readLine()) != null) {
                stringList.add(tempStr);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return stringList;
    }

}
